<?php
/**
 * Created by JetBrains PhpStorm.
 * User: shauan
 * Date: 07/09/13
 * Time: 20:03
 * To change this template use File | Settings | File Templates.
 */
//App::uses('Component','Controller');q

class MsgComponent extends Component {

    public function showBox($value = array())
    {
        $_close = '';
        if(!empty($value) && $value == null){
            if(is_array($value))
            {
                if($value['close'] == true)
                {
                    $_close = '<button type="button" class="close" data-dismiss="alert">&times;</button>';
                }
                return $this->Session->setFlash($_close.$value['title'].$value['message'],'default',array('escape'=>false,'class'=>'alert alert-'.$value['type']));
            }
        }
    }
}
